package org.developer.invocation;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class DynamicProxy implements InvocationHandler {

    public Object object;

    public DynamicProxy(Object object) {
        this.object = object;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("##method.name   :" + method.getName());
        for(Object o:args){
            System.out.println("##args.value    :" + o);
            System.out.println("##args.class    :" + o.getClass());
        }

        method.invoke(object,args);

        return null;
    }
}
